import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_jd/pages/tabbar/my/controller.dart';
import 'package:flutter_jd/ui/pages/application/goods_list.dart';
import 'package:flutter_jd/ui/pages/my/money_wrap.dart';
import 'package:flutter_jd/ui/pages/my/order_wrap.dart';
import 'package:flutter_jd/ui/pages/my/tools_wrap.dart';
import 'package:flutter_jd/ui/pages/my/top_bar.dart';
import 'package:flutter_jd/ui/pages/my/user_wrap.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:get/route_manager.dart';
import 'package:get/get.dart';

// 我的
class My extends GetView<MyController> {
  @override
  Widget build(BuildContext context) {
    Get.put(MyController());

    return AnnotatedRegion<SystemUiOverlayStyle>(
      value: SystemUiOverlayStyle.light,
      child: Material(
        child: Scaffold(
          body: Stack(children: <Widget>[
            MediaQuery.removePadding(
              context: context,
              removeTop: true,
              child: NotificationListener(
                onNotification: (e) {
                  if (e is ScrollUpdateNotification && e.depth == 0) {
                    controller.onScroll(e.metrics.pixels);
                  }
                  return true;
                },
                child: SingleChildScrollView(
                  child: Container(
                    color: Color(0xFFF2F2F2),
                    child: Column(
                      children: [
                        UserWrap(),
                        MyOrderWrap(),
                        MyMoneyWrap(),
                        MyToolsWrap(),
                        GoodsList(goodsList: controller.goodsList)
                      ],
                    ),
                  ),
                ),
              ),
            ),
            MyTopBar()
          ]),
        ),
      ),
    );
  }
}
